home *** CD-ROM | disk | FTP | other *** search
- Document Type: WSE
- item: Global
- Version=6.0
- Flags=00000100
- Split=1420
- Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- Copy Default=1
- Japanese Font Name=MS Gothic
- Japanese Font Size=10
- Start Gradient=0 0 255
- End Gradient=0 0 0
- Windows Flags=00000100000000000010110000001000
- Message Font=MS Sans Serif
- Font Size=8
- Disk Filename=setup
- Patch Flags=0000000000000001
- Patch Threshold=85
- Patch Memory=4000
- FTP Cluster Size=20
- end
- item: Remark
- Text=This sample script for Wise 6.0 demonstrates how to use the Dialog Event Handler.
- end
- item: Remark
- Text=To see the other 90% of this script, open the dialog. Then click View, Script Editor.
- end
- item: Remark
- Text=The variable DLG_EVENT_TYPE refers to the current event that is occuring in a dialog.
- end
- item: Remark
- Text=The variable will pass either a pre- or user-defined code. See your documentation for the pre-defined codes.
- end
- item: Remark
- end
- item: Custom Dialog Set
- Name=Event Handler
- item: Dialog
- Title=Event Handler
- Width=170
- Height=170
- Font Name=Helv
- Font Size=8
- item: Push Button
- Control Name=ShowExit
- Rectangle=3 89 48 104
- Alternate=ShowExit
- Action=7
- Enabled Color=00000000000000001111111111111111
- Create Flags=01010000000000010000000000000000
- Text=&Show Exit
- end
- item: Push Button
- Control Name=HideExit
- Rectangle=58 89 103 104
- Alternate=HideExit
- Action=7
- Enabled Color=00000000000000001111111111111111
- Create Flags=01010000000000010000000000000001
- Text=&Hide Exit
- end
- item: Push Button
- Control Name=Exit
- Rectangle=58 119 103 134
- Action=1
- Enabled Color=00000000000000001111111111111111
- Create Flags=01010000000000010000000000000000
- Text=E&xit
- end
- item: Static
- Control Name=ExitMessage
- Rectangle=20 32 144 49
- Enabled Color=00000000000000001111111111111111
- Create Flags=01010000000000000000000000000001
- Text=%EXITMESSAGE%
- end
- item: Push Button
- Control Name=DisableEnableExit
- Rectangle=114 89 159 104
- Alternate=DisableEnableExit
- Action=7
- Enabled Color=00000000000000001111111111111111
- Create Flags=01010000000000010000000000000000
- Text=Enable Exit
- end
- item: Remark
- Text=This is the Event Handler, where most of the workings of this script are.
- end
- item: Remark
- Text=In order to define a sub-routine, you must name it in the control that it is linked to.
- end
- item: Remark
- Text=This is done in the Execute Named Event action inside the push button.
- end
- item: Remark
- end
- item: Remark
- Text=The variable Disabledflag is set depending upon the state of the exit button.
- end
- item: Remark
- Text=The variable Exitmessage is set to the current message to display.
- end
- item: Remark
- end
- item: Remark
- Text=The value of "INIT" in the DLG_EVENT_TYPE variable is defined by Wise, meaning that the dialog is loading up,
- end
- item: Remark
- Text= and the controls on it have not been shown yet. In this case, the following block runs the HideExit sub
- end
- item: Remark
- Text= when it is loaded. It has the effect of setting the Dialog defaults.
- end
- item: If/While Statement
- Variable=DLG_EVENT_TYPE
- Value=INIT
- end
- item: Set Variable
- Variable=DLG_EVENT_TYPE
- Value=HideExit
- end
- item: Set Variable
- Variable=DISABLEDFLAG
- Value=Yes
- end
- item: Set Variable
- Variable=EXITMESSAGE
- Value=The exit button is hidden.
- end
- item: End Block
- end
- item: Remark
- end
- item: Remark
- Text=This sub is run when the Show Exit button is clicked.
- end
- item: Remark
- Text=Its main function is to display the exit button.
- end
- item: If/While Statement
- Variable=DLG_EVENT_TYPE
- Value=ShowExit
- end
- item: Set Control Attribute
- Control Name=ShowExit
- Operation=1
- end
- item: Set Control Attribute
- Control Name=HideExit
- end
- item: Set Control Attribute
- Control Name=DisableEnableExit
- end
- item: Remark
- end
- item: Remark
- Text=This nested If Statement checks to see if the last state of the exit button was disabled or not.
- end
- item: If/While Statement
- Variable=DISABLEDFLAG
- Value=Yes
- end
- item: Set Variable
- Variable=EXITMESSAGE
- Value=The exit button is visible, but disabled.
- end
- item: Set Control Attribute
- Control Name=Exit
- end
- item: Set Control Attribute
- Control Name=Exit
- Operation=1
- end
- item: Else Statement
- end
- item: Set Variable
- Variable=EXITMESSAGE
- Value=The exit button is visible and enabled.
- end
- item: Set Control Attribute
- Control Name=Exit
- end
- item: End Block
- end
- item: Remark
- end
- item: End Block
- end
- item: Remark
- end
- item: Remark
- Text=This sub is run when the Hide Exit button is clicked.
- end
- item: Remark
- Text=Its main function is to hide the exit button.
- end
- item: If/While Statement
- Variable=DLG_EVENT_TYPE
- Value=HideExit
- end
- item: Set Variable
- Variable=EXITMESSAGE
- Value=The exit button is hidden.
- end
- item: Set Control Attribute
- Control Name=HideExit
- Operation=1
- end
- item: Set Control Attribute
- Control Name=ShowExit
- end
- item: Set Control Attribute
- Control Name=Exit
- Operation=2
- end
- item: Set Control Attribute
- Control Name=DisableEnableExit
- Operation=1
- end
- item: End Block
- end
- item: Remark
- end
- item: Remark
- Text=This sub is run when the Enable/Disable Exit button is clicked.
- end
- item: Remark
- Text=Its main function is to change the state of the Exit button
- end
- item: Remark
- Text= and to change the text of the button Enable/Disable button itself.
- end
- item: If/While Statement
- Variable=DLG_EVENT_TYPE
- Value=DisableEnableExit
- end
- item: If/While Statement
- Variable=DISABLEDFLAG
- Value=Yes
- end
- item: Set Variable
- Variable=DISABLEDFLAG
- Value=No
- end
- item: Set Control Attribute
- Control Name=Exit
- end
- item: Set Variable
- Variable=EXITMESSAGE
- Value=The exit button is visible and enabled.
- end
- item: Set Control Text
- Control Name=DisableEnableExit
- Control Text=Disable Exit
- end
- item: Else Statement
- end
- item: Set Variable
- Variable=DISABLEDFLAG
- Value=Yes
- end
- item: Set Control Attribute
- Control Name=Exit
- Operation=1
- end
- item: Set Variable
- Variable=EXITMESSAGE
- Value=The exit button is visible, but disabled.
- end
- item: Set Control Text
- Control Name=DisableEnableExit
- Control Text=Enable Exit
- end
- item: End Block
- end
- item: End Block
- end
- end
- end
-